package com.lyf;

import com.lyf.aop.spring.annotation.UserService;
import com.lyf.beans.UserBean;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @AUTHOR LYF
 * @DATE 2022/2/12
 * @VERSION 1.0
 * @DESC
 */
public class SpringMain {
    public static void main(String[] args) {
        String path = "bean.xml";
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(path);
        //context.getBean();
//        UserBean user = (UserBean) context.getBean("userBean");
//        System.out.println(user.getAge());
        //userService.add();
        UserService userService  = (UserService) context.getBean("userService");
        userService.add();
        //Caused by: java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException
    }
}
